function s(){
//0，页面初次渲染的时候，小计会是每个商品的单价*数量
    let tr=document.querySelectorAll('#sssc .asd');
    console.log(tr)
//总价;
    let all=document.querySelector('#all');
    let allnum = 0;
    for (let i=0;i<tr.length;i++){
        var price=tr[i].children[1].children[1].innerHTML
        var num=tr[i].children[1].children[2].value;
        //小计
        var total=tr[i].children[1].children[3].children[0].innerHTML=price * num;
        console.log(total);
        allnum += total
    }

    console.log(allnum);
//1,页面初次渲染的时候，小计和总和赋值给总价
    all.innerHTML=allnum.toFixed(2)
}
s();
//2，只要数量的input内容发生改变，小计和总和就会更新
let num_all=document.querySelectorAll('#sssc .num');
for (let j=0;j < num_all.length;j++){
    num_all[j].addEventListener('change',s)
}
//3,删除操作之后，再根据小计计算总价
let del_all=document.querySelectorAll('#sssc .del');
for (let k=0; k < del_all.length;k++){
    del_all[k].addEventListener('click',function(){
        console.log(this.parentNode.parentNode.parentNode)
        console.log(this.parentNode.parentNode)
        this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
        s();
    })
}